<div class="divColorbox">
    <div class="divColorbox_Header">
        <span><i class="fa fa-star"></i><span>艺人申请审批信息</span></span>
        <a class="Refresh"></a><a class="Close"></a>
    </div>
    <div class="divColorbox_Body row">
        <div>
            <input name="User_ID" type="hidden"/>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">用户ID</span>
                        <input id="User_ID" type="text" class="form-control" value="--" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">昵称</span>
                        <input id="NickName" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">性别</span>
                        <input id="Sex" type="text" class="form-control" disabled/>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">等级</span>
                        <input id="Level" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">金币</span>
                        <input id="Coin" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">金豆</span>
                        <input id="Beans" type="text" class="form-control" disabled/>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">手机号</span>
                        <input id="Anchor_Phone" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">QQ</span>
                        <input id="Anchor_QQ" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">邮箱</span>
                        <input id="Anchor_Email" type="text" class="form-control" disabled/>
                    </div>
                </div>
            </div>
            <div class="hr"></div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">房间名称</span>
                        <input id="RoomName" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-home"></i></span>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">欢迎语</span>
                        <input id="RoomWelcome" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-sign-language"></i></span>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">身份证</span>
                        <input id="IDCard" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">标签</span>
                        <input id="Tags" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-tags"></i></span>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">开户银行</span>
                        <input id="Account_BankName" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-university"></i></span>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">银行全称</span>
                        <input id="Account_BankFullName" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-university"></i></span>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon"> 开户姓名</span>
                        <input id="Account_RealName" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-user"></i></span>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">开户帐号</span>
                        <input id="Account_CardNo" type="text" class="form-control" disabled/>
                        <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon">责任人</span>
                        <select class="form-control" name="Duty_Admin_ID" id="Duty_Admin_ID">
                        </select>
                        <span class="input-group-addon"><i class="fa fa-university"></i></span>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <span class="input-group-addon">身份证正面</span>
                    <input type="button" value="放大" onclick="$.CommonAdmin.imgToSize(50,'J_Anchor_IdCard_A_Img')">
                    <input type="button" value="缩小" onclick="$.CommonAdmin.imgToSize(-50,'J_Anchor_IdCard_A_Img');">
                    <img src="" id="J_Anchor_IdCard_A_Img">
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <span class="input-group-addon">身份证反面</span>
                    <input type="button" value="放大" onclick="$.CommonAdmin.imgToSize(50,'J_Anchor_IdCard_B_Img')">
                    <input type="button" value="缩小" onclick="$.CommonAdmin.imgToSize(-50,'J_Anchor_IdCard_B_Img')">
                    <img src="" id="J_Anchor_IdCard_B_Img">
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <span class="input-group-addon">海报图片</span>
                    <input type="button" value="放大" onclick="$.CommonAdmin.imgToSize(50,'J_Anchor_UserCover_Img')">
                    <input type="button" value="缩小" onclick="$.CommonAdmin.imgToSize(-50,'J_Anchor_UserCover_Img')">
                    <img src="" id="J_Anchor_UserCover_Img">
                </div>
            </div>
        </div>
    </div>
    <div class="divColorbox_Footer">
        <button type="button" id="btnEdit_Agree" class="btn btn-primary">
            <i class="fa fa-check"></i> 审核通过
        </button>
        <button type="button" id="btnEdit_Disagree" class="btn btn-warning">
            <i class="fa fa-close"></i> 驳回申请
        </button>
        <button type="button" id="btnUndo"></button>
    </div>
</div>
<script>
    $(function () {
        if (_PageData.flag != 0) {
            $.KOC.Tips.Open("Error", _PageData.flag, {
                Timeout: 1000,
                onClose: function () {
                    parent.$.colorbox.close();
                }
            });
            return;
        }
        //////////////////////////////////////////////////////////
        //通过申请
        //////////////////////////////////////////////////////////
        $('#btnEdit_Agree').on('click', function () {
            var params = {};
            params.User_ID = $.trim($('#User_ID').val());
            params.Duty_Admin_ID = $.trim($('#Duty_Admin_ID').val());
            params.Duty_RealName = $.trim($('#Duty_Admin_ID').find("option:selected").text()) == '--' ? '0' : $.trim($('#Duty_Admin_ID').find("option:selected").text());
            if (!params.User_ID) {
                $.KOC.Tips.Open('Error', '数据出错请刷新', {Timeout: 2000});
                return false;
            }
            $.KOC.Loading.Open();
            $.ajax({
                url: '/ajax/user.user-anchor.anchorcheck',
                type: 'post',
                dataType: 'json',
                data: {
                    User_ID: params.User_ID,
                    Status: 1,
                    Duty_Admin_ID:params.Duty_Admin_ID,
                    Duty_RealName:params.Duty_RealName
                },
                success: function (data) {
                    $.KOC.Loading.Close();
                    if (data.flag !== 0) {
                        $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 2000});
                        return;
                    }
                    $.KOC.Tips.Open('Success', '审核完成', {
                        Timeout: 1000,
                        onClose: function () {
                            parent.$.colorbox.close();
                            parent.window.location.href = "/user-manage/anchor-manage/list";
                        }
                    });
                }
            });
        });
        //////////////////////////////////////////////////////////
        //驳回申请
        //////////////////////////////////////////////////////////
        $('#btnEdit_Disagree').on('click', function () {
            var params = {};
            params.User_ID = $.trim($('#User_ID').val());
            params.Duty_Admin_ID = $.trim($('#Duty_Admin_ID').val());
            params.Duty_RealName = $.trim($('#Duty_Admin_ID').find("option:selected").text()) == '--' ? '0' : $.trim($('#Duty_Admin_ID').find("option:selected").text());
            if (!params.User_ID) {
                $.KOC.Tips.Open('Error', '数据出错请刷新', {Timeout: 2000});
                return false;
            }
            $.KOC.Loading.Open();
            $.ajax({
                url: '/ajax/user.user-anchor.anchorcheck',
                type: 'post',
                dataType: 'json',
                data: {
                    User_ID: params.User_ID,
                    Status: 2,
                    Duty_Admin_ID:params.Duty_Admin_ID,
                    Duty_RealName:params.Duty_RealName
                },
                success: function (data) {
                    $.KOC.Loading.Close();
                    if (data.flag !== 0) {
                        $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 2000});
                        return;
                    }
                    $.KOC.Tips.Open('Success', '审核完成', {
                        Timeout: 1000,
                        onClose: function () {
                            parent.$.colorbox.close();
                            parent.window.location.href = "/user-manage/anchor-manage/list";
                        }
                    });
                }
            });
        });
        //////////////////////////////////////////////////////////
        //数据绑定
        //////////////////////////////////////////////////////////
        $('#J_Anchor_IdCard_A_Img').attr('src', _VirtualPath.Utils + "service/img/user/idcard-a/" + _PageData.User_ID + ".jpg");
        $('#J_Anchor_IdCard_B_Img').attr('src', _VirtualPath.Utils + "service/img/user/idcard-b/" + _PageData.User_ID + ".jpg");
        $('#J_Anchor_UserCover_Img').attr('src', $.Common.ImageBind.UserCover.fnURL(_PageData.User_ID, "442.442"));
        $('#User_ID').val(_PageData.User_ID);
        $('#NickName').val(_PageData.NickName);
        $('#Level').val(_PageData.Anchor_Level);
        $('#Coin').val(_PageData.Coin);
        $('#Beans').val(_PageData.Beans);
        $('#Anchor_Email').val(_PageData.Anchor_Email);
        $('#Anchor_Phone').val(_PageData.Anchor_Phone);
        $('#Anchor_QQ').val(_PageData.Anchor_QQ);

        $('#RoomName').val(_PageData.RoomName);
        $('#RoomWelcome').val(_PageData.RoomWelcome);
        $('#IDCard').val(_PageData.IDCard);
        $('#Tags').val(_PageData.Tags);
        $('#Account_BankName').val(_PageData.Account_BankName);
        $('#Account_BankFullName').val(_PageData.Account_BankFullName);
        $('#Account_RealName').val(_PageData.Account_RealName);
        $('#Account_CardNo').val(_PageData.Account_CardNo);
        //////////////////////////////////////////////////////////
        //责任人
        //////////////////////////////////////////////////////////
        var Duty = '<option value="0" selected>--</option>';
        for (var n = 0; n < _PageData.aaData.length; n++) {
            Duty += '<option value="' + _PageData.aaData[n].User_ID + '">' + _PageData.aaData[n].RealName + '</option>';
        }
        $('#Duty_Admin_ID').empty().append(Duty);
        switch (_PageData.Sex) {
            case 1 :
                $("#Sex").val('男');
                break;
            case 2 :
                $("#Sex").val('女');
                break;
            default:
                $('#Sex').val('');
                break;
        }
    });
</script>